<?php
/* -=-=-=-=-=-=-=-=-=-=-=-=-
     author by terry
-=-=-=-=-=-=-=-=-=-=-=-=- */
error_reporting(7);
require "global.php";
cpheader();
//set offset
if(!empty($_POST[offset]))
{$offset = $_POST[offset];}
else if  (!empty($_GET[offset]))
{$offset = $_GET[offset]; }
else  {$offset = 0; }


if ($_GET[action]=="add"||$_GET[action]=='mod'||$_GET[action]=='view'){

    $cpforms->inithtmlarea();
	if($_GET[action]=="add"){
			$cpforms->formheader(array('title'=>'Add New Skype Chat (<font color=red>*</font>=Required Field)',
										'name'=>'article',
			                             'enctype'=>'multipart/form-data'));

			$cpforms->makehidden(array('name'=>'action',
									   'value'=>'doinsert'));
			$rs[sp_showtop] = "1";
			$rs[StartDate] = $rs[EndDate] = time();
	}
	if($_GET[action] == "mod"){
			$cpforms->formheader(array('title'=>'Modify Skype Chat (<font color=red>*</font>=Required Field)',
										'name'=>'article',
				                        'enctype'=>'multipart/form-data'));

			$cpforms->makehidden(array('name'=>'action',
									   'value'=>'update'));
		    $skypechatid = intval($_GET[id]);
			$cpforms->makehidden(array('name'=>'id',
									   'value'=>$skypechatid));
			$cpforms->makehidden(array('name'=>'offset',
									   'value'=>$offset));
            $read =1;
	        $rs  = $DB->fetch_one_array("SELECT * FROM ".$db_prefix."skypechat WHERE sp_id =".$skypechatid);
            

	}

	if($_GET[action]=="view"){
			$cpforms->formheader(array('title'=>'View Skype Chat (<font color=red>*</font>=Required Field)',
										'name'=>'article',
				                        'enctype'=>'multipart/form-data'));
		    $skypechatid = intval($_GET[id]);
			$cpforms->makehidden(array('name'=>'id',
									   'value'=>$skypechatid));
			$cpforms->makehidden(array('name'=>'offset',
									   'value'=>$offset));
            $view =1;
	        $rs  = $DB->fetch_one_array("SELECT * FROM ".$db_prefix."skypechat WHERE sp_id =".$skypechatid);
	}
	?>
     <?       

		  echo ' <link rel="stylesheet" type="text/css" media="all" href="../jscalendar/calendar-win2k-cold-1.css" title="win2k-cold-1" />
               <script type="text/javascript" src="../jscalendar/calendar.js"></script>
               <script type="text/javascript" src="../jscalendar/lang/calendar-en.js"></script>
               <script type="text/javascript" src="../jscalendar/calendar-setup.js"></script>
				   <script>
				function CheckAll(va){
					var va;
					var a = document.getElementsByName(va);
					var n = a.length;
					for (var i=0;i<n;i++){
					  a[i].checked = true;
					}
				}

				function CheckOutAll(va){
					var va;
					var a = document.getElementsByName(va);
					var n = a.length;
					for (var i=0;i<n;i++){
					  a[i].checked = false;
					}
				}   
			   </script>';
		  echo '<tr><td><table width="100%" border="0" cellpadding="0" cellspacing="0" >
		           <tr>      
		              <td colspan="2"><table width="100%"  border="0" cellspacing="2" cellpadding="5" >
		                   <td><strong>Topic Title:</strong></td>
							<td>
								<input type="text" size="35" name="title" value="'.$rs[sp_topic].'"/>
							</td>
							</tr>
							<tr>
								<td><strong>Skype ID:</strong></td>
								<td>
									<input type="text" size="35" name="skypeid" value="'.$rs[sp_skype].'" />
								</td>
							</tr>
							<tr>
								<td><strong>Date:</strong></td>
								<td>
									<input  type="text" name="date" size="25" id="f_date_c" readonly value="'.$rs[sp_date].'"><img src="images/img.gif" id="f_trigger_c" style="cursor: pointer; border: 0px solid red;" align="absmiddle" title="Date selector" />
									<script type="text/javascript">
									Calendar.setup({
										inputField     :    "f_date_c",     // id of the input field
										ifFormat       :    "%m/%d/%Y",      // format of the input field
										button         :    "f_trigger_c",  // trigger for the calendar (button ID)
										align          :    "Tl",           // alignment (defaults to "Bl")
										singleClick    :    true
									});
									</script>
								</td>
							</tr>';
						
   $rs[fromhour] = @substr($rs[sp_starttime ],0,2);$rs[frommin] = @substr($rs[sp_starttime],2,2);
   $rs[tohour]   = @substr($rs[sp_endtime],0,2);   $rs[tomin] = @substr($rs[sp_endtime],2,2);

   $fh['a'.$rs[fromhour]] = " selected ";
   $ft['a'.$rs[frommin]] = " selected ";
   $th['a'.$rs[tohour]] = " selected ";
   $tt['a'.$rs[tomin]] = " selected ";

						echo '	<tr>
								<td><strong>Time:</strong></td>
								<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
								    <tr><td>
									<select name="fromhour">
										<option label="00" value="00" '.$fh[a00].'>00</option>
										<option label="01" value="01" '.$fh[a01].'>01</option>
										<option label="02" value="02" '.$fh[a02].'>02</option>
										<option label="03" value="03" '.$fh[a03].'>03</option>
										<option label="04" value="04" '.$fh[a04].'>04</option>
										<option label="05" value="05" '.$fh[a05].'>05</option>
										<option label="06" value="06" '.$fh[a06].'>06</option>
										<option label="07" value="07" '.$fh[a07].'>07</option>
										<option label="08" value="08" '.$fh[a08].'>08</option>
										<option label="09" value="09" '.$fh[a09].'>09</option>
										<option label="10" value="10" '.$fh[a10].'>10</option>
										<option label="11" value="11" '.$fh[a11].'>11</option>
										<option label="12" value="12" '.$fh[a12].'>12</option>
										<option label="13" value="13" '.$fh[a13].'>13</option>
										<option label="14" value="14" '.$fh[a14].'>14</option>
										<option label="15" value="15" '.$fh[a15].'>15</option>
										<option label="16" value="16" '.$fh[a16].'>16</option>
										<option label="17" value="17" '.$fh[a17].'>17</option>
										<option label="18" value="18" '.$fh[a18].'>18</option>
										<option label="19" value="19" '.$fh[a19].'>19</option>
										<option label="20" value="20" '.$fh[a20].'>20</option>
										<option label="12" value="21" '.$fh[a21].'>12</option>
										<option label="22" value="22" '.$fh[a22].'>22</option>
										<option label="23" value="23" '.$fh[a23].'>23</option>
									</select>:
									<select name="frommin">
										<option label="00" value="00" '.$ft[a00].'>00</option>
										<option label="05" value="05" '.$ft[a05].'>05</option>
										<option label="10" value="10" '.$ft[a10].'>10</option>
										<option label="15" value="15" '.$ft[a15].'>15</option>
										<option label="20" value="20" '.$ft[a20].'>20</option>
										<option label="25" value="25" '.$ft[a25].'>25</option>
										<option label="30" value="30" '.$ft[a30].'>30</option>
										<option label="35" value="35" '.$ft[a35].'>35</option>
										<option label="40" value="40" '.$ft[a40].'>40</option>
										<option label="45" value="45" '.$ft[a45].'>45</option>
										<option label="50" value="50" '.$ft[a50].'>50</option>
										<option label="55" value="55" '.$ft[a55].'>55</option>
									</select>
									</td>
									<td><strong>To:</strong></td>
									<td>
									<select name="tohour">
										<option label="00" value="00" '.$th[a00].'>00</option>
										<option label="01" value="01" '.$th[a01].'>01</option>
										<option label="02" value="02" '.$th[a02].'>02</option>
										<option label="03" value="03" '.$th[a03].'>03</option>
										<option label="04" value="04" '.$th[a04].'>04</option>
										<option label="05" value="05" '.$th[a05].'>05</option>
										<option label="06" value="06" '.$th[a06].'>06</option>
										<option label="07" value="07" '.$th[a07].'>07</option>
										<option label="08" value="08" '.$th[a08].'>08</option>
										<option label="09" value="09" '.$th[a09].'>09</option>
										<option label="10" value="10" '.$th[a10].'>10</option>
										<option label="11" value="11" '.$th[a11].'>11</option>
										<option label="12" value="12" '.$th[a12].'>12</option>
										<option label="13" value="13" '.$th[a13].'>13</option>
										<option label="14" value="14" '.$th[a14].'>14</option>
										<option label="15" value="15" '.$th[a15].'>15</option>
										<option label="16" value="16" '.$th[a16].'>16</option>
										<option label="17" value="17" '.$th[a17].'>17</option>
										<option label="18" value="18" '.$th[a18].'>18</option>
										<option label="19" value="19" '.$th[a19].'>19</option>
										<option label="20" value="20" '.$th[a20].'>20</option>
										<option label="12" value="21" '.$th[a21].'>12</option>
										<option label="22" value="22" '.$th[a22].'>22</option>
										<option label="23" value="23" '.$th[a23].'>23</option>
									</select>:
									<select name="tomin">
										<option label="00" value="00" '.$tt[a00].'>00</option>
										<option label="05" value="05" '.$tt[a05].'>05</option>
										<option label="10" value="10" '.$tt[a10].'>10</option>
										<option label="15" value="15" '.$tt[a15].'>15</option>
										<option label="20" value="20" '.$tt[a20].'>20</option>
										<option label="25" value="25" '.$tt[a25].'>25</option>
										<option label="30" value="30" '.$tt[a30].'>30</option>
										<option label="35" value="35" '.$tt[a35].'>35</option>
										<option label="40" value="40" '.$tt[a40].'>40</option>
										<option label="45" value="45" '.$tt[a45].'>45</option>
										<option label="50" value="50" '.$tt[a50].'>50</option>
										<option label="55" value="55" '.$tt[a55].'>55</option>
									</select>
									</td>
								    </tr>
								</table>
								</td>
							</tr>
							<tr>
								<td><strong>Time Zone:</strong></td>
								<td>
									<input type="text" size="35" name="timezone" value="'.$rs[sp_timezone].'" />
								</td>
							</tr>
							<tr>
								<td><strong>Full Name:</strong></td>
								<td>
									<input type="text" size="35" name="fullname" value="'.$rs[sp_fullname].'" />
								</td>
							</tr>
							<tr>
								<td><strong>Email:</strong></td>
								<td>
									<input type="text" size="35" name="email" value="'.$rs[sp_uemail].'" />
								</td>
							</tr>
							<tr>
								<td><strong>Language Spoken:</strong></td>
								<td>
									<input type="text" size="35" name="spoken" value="'.$rs[sp_language].'" />
								</td>
							</tr>
							<tr>
								<td colspan="2"><strong>Select Pages:</strong></td>
							</tr>';
   $rs[page1] = (@ereg('1',$rs['sp_selectpage']))?" checked ":"";
   $rs[page2] = (@ereg('2',$rs['sp_selectpage']))?" checked ":"";
   $rs[page3] = (@ereg('3',$rs['sp_selectpage']))?" checked ":"";
   $rs[page4] = (@ereg('4',$rs['sp_selectpage']))?" checked ":"";

					echo		'<tr>
								<td colspan="2">
									<input name="pri[]" type="checkbox" value="1"   '. $rs[page1].'/>
									Employers<br />
									<input name="pri[]" type="checkbox" value="2"   '. $rs[page2].'/>
									Candidates<br />
									<input name="pri[]" type="checkbox" value="3"   '. $rs[page3].'/>
									Recruiters<br />
									<input name="pri[]" type="checkbox" value="4"   '. $rs[page4].'/>
									Advisors </td>
							</tr>
							<tr>
								<td colspan="2"> [<a href="javascript:" onclick="CheckAll(\'pri[]\')">Select All</a>] [<a href="javascript:" onclick="CheckOutAll(\'pri[]\')">Reset</a>] </td>
							</tr>';
   $checkstatus = ($rs[sp_status]==1)?" checked ":" "; 
   $checkcolor[$rs[sp_color]] = " checked ";
					echo	'<tr>
								<td colspan="2"><strong>Activate:</strong> <input name="active" type="checkbox" value="1"  '.$checkstatus.' /></td>
							</tr>';

  if($rs[sp_chattype]==1){  echo '<tr>
								<td colspan="2"><strong>Color:</strong>  
								<label><input type="radio" name="color" value="1" '.$checkcolor[1].'/><img src="../images/smallblock1.gif" border="0" width="10" style="margin:0;padding:0" /></label>&nbsp;
								<label><input type="radio" name="color" value="2" '.$checkcolor[2].'/><img src="../images/smallblock2.gif" border="0" width="10" style="margin:0;padding:0" /></label>&nbsp;
								<label><input type="radio" name="color" value="3" '.$checkcolor[3].'/><img src="../images/smallblock3.gif" border="0" width="10" style="margin:0;padding:0" /></label>&nbsp;
								<label><input type="radio" name="color" value="4" '.$checkcolor[4].'/><img src="../images/smallblock4.gif" border="0" width="10" style="margin:0;padding:0"
								/></label>
								</td>
							</tr>';}
 $checktop = ($rs[sp_top3]==1)?" checked ":"";
					echo	   '<tr>
									<td colspan="2"><strong>Top 3:</strong> <input name="top3" type="checkbox" value="1"  '.$checktop.' /></td>
								</tr>';
					echo 		'<tr>
								<td colspan="2">
									<input type="hidden" name="id" value="'.$_GET[id].'" />
								</td>
							</tr></table></td>
							<td width="60%"></td></tr>';

     ?>

<?
		
      if($_GET[action]=="view"){$cpforms->noformfooter();}
	   else{ $cpforms->formfooter(array('confirm'=>1,'colspan'=>6));}
}


if ($_GET[action]=="list"){


	if($_GET[action]=="list"){   
		$nav = new buildNav;

		$total = $DB->fetch_one_array("SELECT COUNT(*) AS count FROM ".$db_prefix."skypechat");

		$nav->total_result = $total[count];
 
		if (empty($total[count])) {
			pa_exit("<font color=red>N/A</font>");
		}
		$by = "sp_id"; 
		$order = "DESC";
        $_GET[order1]==''&&$order1=1;$_GET[order2]==''&&$order2=1;$_GET[order3]==''&&$order3=1;$_GET[order4]==''&&$order4=1;
		$_GET[order5]==''&&$order5=1;$_GET[order6]==''&&$order6=1;$_GET[order7]==''&&$order7=1;$_GET[order8]==''&&$order8=1;$_GET[order9]==''&&$order9=1;$_GET[order10]==''&&$order10=1;
		switch($_GET[swh]){
		   case 1:
			   $by = "sp_date";
               if($_GET[order1]==1){$order1=2; $order=" DESC ";
			   $image1 = "<img src=\"images/dot1.gif\">";}else{$order1=1;$order=" ASC ";
			   $image1 = "<img src=\"images/dot2.gif\">";}
			   break;
		   case 3:
                $by = "sp_topic";
               if($_GET[order3]==1){$order3=2; $order=" DESC ";$image3 = "<img src=\"images/dot1.gif\">";}else{$order3=1;$order=" ASC ";$image3 = "<img src=\"images/dot2.gif\">";}
			   break;
		   case 4:
               $by = "sp_name";
               if($_GET[order4]==1){$order4=2; $order=" DESC ";$image4 = "<img src=\"images/dot1.gif\">";}else{$order4=1;$order=" ASC ";$image4 = "<img src=\"images/dot2.gif\">";}
			   break;	
		    case 5:
                $by = "sp_language";
               if($_GET[order5]==1){$order5=2; $order=" DESC ";$image5 = "<img src=\"images/dot1.gif\">";}else{$order5=1;$order=" ASC ";$image5 = "<img src=\"images/dot2.gif\">";}
			   break;	
    	    case 6:
               $by = "sp_chattype";
               if($_GET[order6]==1){$order6=2; $order=" DESC ";$image6 = "<img src=\"images/dot1.gif\">";}else{$order6=1;$order=" ASC ";$image6 = "<img src=\"images/dot2.gif\">";}
			   break;	
		   case 7:
               $by = "sp_top3";
               if($_GET[order7]==1){$order7=2; $order=" DESC ";$image7 = "<img src=\"images/dot1.gif\">";}else{$order7=1;$order=" ASC ";$image7 = "<img src=\"images/dot2.gif\">";}
			   break;	
			case 8:
               $by = "sp_status";
               if($_GET[order8]==1){$order8=2; $order=" DESC ";$image8 = "<img src=\"images/dot1.gif\">";}else{$order8=1;$order=" ASC ";$image8 = "<img src=\"images/dot2.gif\">";}
			   break;	
		}

		
		$order = " ORDER BY $by $order";
		$nav->execute("SELECT * FROM ".$db_prefix."skypechat $order");

    }
	
	echo $nav->title("Skype Chat List");
    echo $nav->pagenav();

    echo "<table border=\"0\" width=\"100%\" cellpadding=\"4\" cellspacing=\"1\" class=\"tableoutline\">
	<script type=\"text/javascript\" src=\"http://download.skype.com/share/skypebuttons/js/skypeCheck.js\"></script>
	   <tr align=\"center\" class=\"tbhead\">
		<td nowrap  width=\"10%\"><a href=\"chat.php?action=list&offset=$_GET[offset]&order1=$order1&swh=1\">$image1 Date </a></td>
		<td nowrap  width=\"10%\"> Online Time </td>
		<td nowrap  width=\"10%\"><a href=\"chat.php?action=list&offset=$_GET[offset]&order3=$order3&swh=3\">$image3 Topic</a></td>
		 <td nowrap  width=\"10%\"><a href=\"chat.php?action=list&offset=$_GET[offset]&order4=$order4&swh=4\">$image4 Name </a></td>
		 <td nowrap  width=\"10%\"><a href=\"chat.php?action=list&offset=$_GET[offset]&order5=$order5&swh=5\">$image5 Language </a></td>
		 <td nowrap  width=\"10%\"><a href=\"chat.php?action=list&offset=$_GET[offset]&order6=$order6&swh=6\">$image6 Type </a></td>
		 <td nowrap  width=\"10%\"><a href=\"chat.php?action=list&offset=$_GET[offset]&order7=$order7&swh=7\">$image7 Top3 </a></td>
		 <td nowrap  width=\"10%\"><a href=\"chat.php?action=list&offset=$_GET[offset]&order8=$order8&swh=8\">$image8 Active Status </a></td>
		 <td nowrap  width=\"10%\"> Action </td>
	   </tr>\n";
    while ($list = $DB->fetch_array($nav->sql_result)){
		   $list[sp_status] =( $list[sp_status]==1)?"Active":"De-Active";
		   $list[sp_top3]   = ($list[sp_top3]==1)?"YES":"";
           echo "<tr class=".getrowbg().">
                      <td align=\"left\" >".date('m/d/Y',strtotime($list[sp_date]))."</td>
					  <td align=\"left\" >".preg_replace('/([0-9]{2})([0-9]{2})/i','\1:\2',$list[sp_starttime])." - ".preg_replace('/([0-9]{2})([0-9]{2})/i','\1:\2',$list[sp_endtime])."(".$list[sp_timezone].")</td>
					  <td align=\"left\" >".$list[sp_topic]."</td>
                      <td align=\"left\" >".$list[sp_fullname]."</td>
					  <td align=\"left\" >".$list[sp_language]."</td>
					  <td align=\"left\" >".$chat_public[$list[sp_chattype]]."</td>
					  <td align=\"left\" >".$list[sp_top3]."</td>
					  <td align=\"left\" >".$list[sp_status]."</td>
                      <td align=\"left\" nowrap> <a href=\"chat.php?action=mod&offset=$_GET[offset]&id=$list[sp_id]\">Edit</a> | <a href=\"chat.php?action=kill&offset=$_GET[offset]&id=$list[sp_id]\">Delete</a>";
    }
	if(empty($total[count])){
			echo "<tr><td><font color=red>No results!</font></td></tr>";
   }
    echo "</table>\n";
    echo $nav->pagenav();
}

if ($_GET[action]=="kill"){
    $cpforms->formheader(array('title'=>'Sure to delete this?'));
    $cpforms->makehidden(array('name'=>'action',
                                'value'=>'remove'));
    $cpforms->makehidden(array('name'=>'skypechatid',
                                'value'=>$_GET[id]));
	$cpforms->makehidden(array('name'=>'offset',
                                'value'=>$_GET[offset]));
    $cpforms->formfooter(array('confirm'=>2));
}


if( $_POST[action]=="remove"){
    $DB->query("DELETE FROM ".$db_prefix."skypechat WHERE sp_id='$_POST[skypechatid]'");
    redirect("./chat.php?action=list&offset=".$offset,"<font color=red>Deleted Successfully!</font>");
}



if ($_POST[action]=="doinsert"){

	$username       = htmlspecialchars(trim($_POST[username]));
	$password       = md5(trim($_POST[password]));
	$firstname      = htmlspecialchars(trim($_POST[firstname]));
	$lastname       = htmlspecialchars(trim($_POST[lastname]));
	$email          = htmlspecialchars(trim($_POST[email]));
	$companyname    = htmlspecialchars(trim($_POST[companyname]));
	$phone          = htmlspecialchars(trim($_POST[phone]));
	$fax            = htmlspecialchars(trim($_POST[fax]));
	$industry       = htmlspecialchars(trim($_POST[industry]));
	$address        = htmlspecialchars(trim($_POST[address]));
	$locity         = htmlspecialchars(trim($_POST[locity]));
	$lostate        = htmlspecialchars(trim($_POST[lostate]));
	$locountry      = htmlspecialchars(trim($_POST[locountry]));
	$generalarea    = htmlspecialchars(trim($_POST[generalarea]));
	$indicate       = htmlspecialchars(trim($_POST[indicate]));
	$spokenlanguage = htmlspecialchars(trim($_POST[spokenlanguage]));
	$subjectdes     = ucfirst(htmlspecialchars(trim($_POST[subjectdes])));
	$shortdes       = ucfirst(htmlspecialchars(trim($_POST[shortdes])));
	$longdes        = ucfirst(htmlspecialchars(trim($_POST[longdes])));
	$top3           = htmlspecialchars(trim($_POST[top3]));

	$description    = ucfirst(htmlspecialchars(trim($_POST[description])));
    
    $date = date("Y-m-d",time());
	$sql = "INSERT INTO ".$db_prefix."skypechat (  `sp_uname` , `sp_pword` , `sp_fname` , `sp_lname` , `sp_copname`, `sp_uemail` , `sp_phone` , `sp_fax` , `sp_industry` ,`sp_address`, `sp_city` , `sp_state` ,`sp_top3` ,`sp_country` , `sp_generalarea` , `sp_indicate` , `sp_spoken` , `sp_subjectdes` , `sp_shortdes` , `sp_longdes` , `sp_upload`  , `sp_regtime` ) 
   VALUES (
	'".$username."', '".$password."', '".$firstname."', '".$lastname."', '".$companyname."', '".$email."','".$phone."', '".$fax."', '".$industry."','".$address."', '".$locity."', '".$lostate."','".$top3."', '".$locountry."', '".$generalarea."', '".$indicate."', '".$spokenlanguage."', '".$subjectdes."', '".$shortdes."', '".$longdes."', '".$filename1p."', '".time()."'
	);";
    $DB->query($sql);

    redirect("./chat.php?action=list","<font color=red>Added Successfully!</font>");
}


if ($_POST[action]=="update"){
	$title      = htmlspecialchars(trim($_POST[title]));
	$skypeid    = htmlspecialchars(trim($_POST[skypeid]));
	$date       = htmlspecialchars(trim($_POST['date']));
	$email      = htmlspecialchars(trim($_POST['email']));
	$fullname   = htmlspecialchars(trim($_POST['fullname']));
	$fromhour   = htmlspecialchars(trim($_POST[fromhour]));
	$frommin    = htmlspecialchars(trim($_POST[frommin]));
	$tohour     = htmlspecialchars(trim($_POST[tohour]));
	$tomin      = htmlspecialchars(trim($_POST[tomin]));
	$timezone   = htmlspecialchars(trim($_POST[timezone]));
	$spoken     = htmlspecialchars(trim($_POST[spoken]));
	$pri        = @implode(",",$_POST[pri]);
	$active     = htmlspecialchars(trim($_POST[active]));
	$color      = htmlspecialchars(trim($_POST[color]));
	$top3       = htmlspecialchars(trim($_POST[top3]));

	$sql = "UPDATE `pa_skypechat` SET  `sp_fullname`='".$fullname."',`sp_uemail`='".$email."',`sp_date`='".$date."',`sp_timezone`='".$timezone."',`sp_starttime`='".$fromhour.$frommin."',`sp_endtime`='".$tohour.$tomin."',`sp_topic`='".$title."',`sp_language`='".$spoken."',`sp_selectpage`='".$pri."',`sp_skype`='".$skypeid."',`sp_status`='".$active."',`sp_color`='".$color."',`sp_top3`='".$top3."'  WHERE  sp_id = '".$_POST[id]."' ";
	$DB->query($sql);


    redirect("./chat.php?action=list&offset=".$offset,"<font color=red>Modified Successfully!</font>");
}
cpfooter();
?>